#include "example1_1.h"
#include "example1_2.h"
#include "example1_3.h"
#include "main.h"
struct StudentPerformance;
int main(){
    printf("第一章\n");
    printf("例1-1\n");
    int amNum = 10;
    int amResult = accumulativeMultiplication(amNum);
    // 计算累乘结果
    printf("{%d!} = %d \n",amNum,amResult);
    printf("例1-2\n");
    struct  StudentPerformance studentPerformances[10] = {
            {"S0001",88},
            {"S0002",60},
            {"S0003",55},
            {"S0004",44},
            {"S0005",99},
            {"S0006",76},
            {"S0007",78},
            {"S0008",79},
            {"S0009",81},
            {"S0010",82}
    };
    int numOfStudents = sizeof(studentPerformances)/sizeof(studentPerformances[0]);
    int passingSore = 60;
    // 打印学生成绩
    studentScoreGreaterThan(studentPerformances,numOfStudents,passingSore);
    printf("例1-3\n");
//    int number;
//    printf("请输入一个大于3的数字");
//    scanf("%d",&number);
//    bool numberIsPrime = isPrime(number);
//    if(numberIsPrime==true){
//        printf("数字[%d]是素数",number);
//    } else{
//        printf("数字[%d]是合数",number);
//    }
    printf("\n 素数:");
    for (int i = 1; i < 10000000; ++i) {
        if(isPrime(i)){
            printf("[%d],",i);
        }
    }
    return 0;
}
